package com.golxen.framework.netty.websocket.shaker;


import com.golxen.framework.netty.websocket.codec.AgentWebSocketDecoder;
import com.golxen.framework.netty.websocket.codec.AgentWebSocketEncoder;
import io.netty.handler.codec.http.websocketx.WebSocketFrameDecoder;
import io.netty.handler.codec.http.websocketx.WebSocketFrameEncoder;
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker07;

public class Handshaker07 extends WebSocketServerHandshaker07 {

    private final boolean allowExtensions0;

    public Handshaker07(String webSocketURL, String subprotocols, boolean allowExtensions,
            int maxFramePayloadLength) {
        super(webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
        this.allowExtensions0 = allowExtensions;
    }

    @Override
    protected WebSocketFrameDecoder newWebsocketDecoder() {
        return new AgentWebSocketDecoder(true, allowExtensions0, maxFramePayloadLength());
    }

    @Override
    protected WebSocketFrameEncoder newWebSocketEncoder() {
        return new AgentWebSocketEncoder();
    }
}
